<template>
	<view class="tabbar-box">
		<view class="tab_box">
			<view class="left" @click="click(0)" :style="{color:selIdx==0?hoverColor:color}">
				<image mode="aspectFit" :src="selIdx==0?list[0].selectedIconPath:list[0].iconPath">
				</image>
				<!-- <view>首页</view> -->
				<!-- <image @click="click0" src="../../static/index/shouye.png" mode="widthFix"></image> -->
			</view>
			<!-- <view class="center" @click="click(1)" :style="{color:selIdx==1?hoverColor:color}">
				<view class="" style="width: 48rpx;height: 48rpx;margin-bottom: 6rpx;">
					<image style="width: 100%;height: 100%;" mode="aspectFit" :src="selIdx==index?list[1].selectedIconPath:list[1].iconPath">
				</view>
				</image>
				<view style="font-weight: bold">去筛查</view>
			</view> -->
			<view class="right" @click="click(2)" :style="{color:selIdx==2?hoverColor:color}">
				<image mode="aspectFit" :src="selIdx==2?list[2].selectedIconPath:list[2].iconPath">
				</image>
				<!-- <view>我的</view> -->
				<!-- <image src="../../static/index/mine.png" mode="widthFix"></image> -->
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	export default {
		computed: {
			...mapState({
				// tabbarlist
				list: (state) => state.list,
				// 当前选中
				selIdx: state => state.selIdx
			})
		},
		props: {

		},
		data() {
			return {
				// 激活颜色
				hoverColor: '#004751',
				// 原本颜色
				color: '#A1B0B3',
				//大图标显示菜单-1为未开启
			}
		},
		methods: {
			click(idx) {
				this.$store.commit('set_selIdx', idx)
				// 跳转页面
				uni.switchTab({
					url: '/' + this.list[idx].pagePath
				})
			},
			// click0(){
			// 	console.log(11111)
			// 	uni.switchTab({
			// 		url:'/pages/index/new_index'
			// 	})
			// }
		}
	}
</script>

<style lang="scss">
	.tabbar-box {
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 999;
		width: 100%;
		height: 150rpx;
		background-color: #ffffff;
		border-radius: 20px 20px 0 0;
		// background-image: url('/static/tabBar/tabbg.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;

		.tab_box {
			position: relative;
			width: 100%;
			height: 85%;
			font-size: 12px;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #A1B0B3;
			
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-around;

			// margin-top: 76rpx;
			

			.left {
				text-align: center;
				// position: absolute;
				// left: 106rpx;
				// top: 76rpx;
				
			}

			.center {
				height: 136rpx;
				width: 136rpx;
				text-align: center;
				position: absolute;
				left: 308rpx;
				top: 25rpx;
				background: #66FFB5;
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
			}

			.right {
				text-align: center;
				// position: absolute;
				// right: 104rpx;
				// top: 76rpx;
			}

			image {
				width: 312rpx;
				height: 72rpx;
			}
		}
	}
</style>
